<?php
// Where the file is going to be placed 
$target_path = "/home/zwu/app/re-eng/files/";

/* Add the original filename to our target path.  
Result is "uploads/filename.extension" */
if ($_FILES["file"]["error"] >0 )
{
  echo "error ".$_FILES["file"]["error"]."<br/";
}
else 
{
   $h =  fopen($target_path."test.txt", "w");
   if (!$h) echo "open error <br/>";
    else
  {
     fwrite($h, "abc");
    fclose($h);
  }
   
   $target_path = $target_path . basename( $_FILES['file']['name']); 

    move_uploaded_file($_FILES["file"]["tmp_name"], $target_path);

    echo "Type: " . $_FILES["file"]["type"] . "<br />";
    echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />";
    echo "uploaded... $target_path";
}

?>
